#
import numpy as np

class FmcwConf(object):
    # Radar parameters
    c = 3e8  # speed of light
    BW = 150e6  # bandwidth
    fc = 77e9  # carrier frequency
    numADC = 256  # # of adc samples
    numChirps = 256  # # of chirps per frame
    numCPI = 10
    T = 10e-6  # PRI
    PRF = 1 / T
    F = numADC / T  # sampling frequency
    dt = 1 / F  # sampling interval
    slope = BW / T
    lambda_ = c / fc
    N = numChirps * numADC * numCPI  # total # of adc samples
    t = np.linspace(0, T * numChirps * numCPI, N)  # time axis, one frame
    t_onePulse = np.arange(0, dt * numADC, dt)
    numTX = 1
    numRX = 8
    Vmax = lambda_ / (T * 4)  # Max Unamb velocity m/s
    DFmax = 1 / 2 * PRF  # Max Unamb Dopp Freq
    dR = c / (2 * BW)  # range resol
    Rmax = F * c / (2 * slope)  # TI's MIMO Radar doc
    Rmax2 = c / 2 / PRF  # lecture 2.3
    dV = lambda_ / (2 * numChirps * T)  # velocity resol, lambda/(2*framePeriod)
    d_rx = lambda_ / 2  # dist. between rxs
    d_tx = 4 * d_rx  # dist. between txs

    N_Dopp = numChirps  # length of doppler FFT
    N_range = numADC  # length of range FFT
    N_azimuth = numTX * numRX
    R = np.arange(0, Rmax, dR)  # range axis
    V = np.linspace(-Vmax, Vmax, numChirps)  # Velocity axis
    ang_ax = np.arange(-90, 91)  # angle axis

    # Targets
    r1_radial = 50
    tar1_angle = -15
    r1_y = np.cos(np.radians(tar1_angle)) * r1_radial
    r1_x = np.sin(np.radians(tar1_angle)) * r1_radial
    v1_radial = 10  # velocity 1
    v1_y = np.cos(np.radians(tar1_angle)) * v1_radial
    v1_x = np.sin(np.radians(tar1_angle)) * v1_radial
    r1 = [r1_x, r1_y, 0]

    r2_radial = 100
    tar2_angle = 10
    r2_y = np.cos(np.radians(tar2_angle)) * r2_radial
    r2_x = np.sin(np.radians(tar2_angle)) * r2_radial
    v2_radial = -15  # velocity 2
    v2_y = np.cos(np.radians(tar2_angle)) * v2_radial
    v2_x = np.sin(np.radians(tar2_angle)) * v2_radial
    r2 = [r2_x, r2_y, 0]



    mixed = None